<?php
/**
 * 系統名稱: Lotto 系統
 * 檔案說明: 專案管理-修改
 * $Author$
 * $Id$
 *
 */
if($_data["op"] == "sendOdds"){
	$arrGamble = getNewGambleData($intLottoID, 0);
	if($arrGamble === false)exit();
	$intGID = $arrGamble["ID"];
}else{
	$intGID = (int)$_data["GambleID"];
}

$isSpecial = (int)$_data["isSpecial"];
if(strlen($_data["isSpecial"]) != 1)$isSpecial = 0;
$isRealShow = (int)$_data["isRealShow"];
$strPreBT = trim($_data["Bet_Type"]);
$arrBType = split(",", $strPreBT);

if($strPreBT == "15")$strPreBT = "12, 13, 14";
$strSQL = "select * from `bet_TodayGame".$intLottoID."` where LottoID = ".$intLottoID." and GambleID = '".$intGID."' and Bet_Type in (".$strPreBT.") order by Bet_Type";

if(!$RS = PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = "Find TodayGame Data Error!!";
	$GLOBALS["errorhidden"] = "Error: ".PMA_mysql_error($$_Conn)."\nSQL:".$strSQL."\nLine:".__LINE__."\nPage:".__FILE__;
	ErrMsgOutputHTML("Error", "", 1);
}

if(PMA_mysql_num_rows($RS) == 0){
	$GLOBALS["errormessage"] = "No TodayGame Data!!";
	ErrMsgOutputHTML("Error", "", 1);
}
	
while($Rows = PMA_mysql_fetch_object($RS)){
	$intApointNum = $_arrGLineNumToApointNum[$Rows -> LottoID][$Rows -> Bet_Type][$Rows -> Number];
	if($intApointNum == null)$intApointNum = 0;
	$flGLine = $_arrGambleType[$Rows -> Bet_Type][$intApointNum];

	$strCon .= '$'."arrGame[".$Rows -> Bet_Type."][".$Rows -> Number."]=array('".$Rows -> LottoID."','".$Rows -> GambleID."','".$Rows -> Bet_Type."','".$Rows -> Number."','".$Rows -> OddsID."','".($Rows -> Odds + $flGLine)."','".$Rows -> isStopBet."');\n";
}
/*=================================================================*/
header("Cache-Control: no-store, no-cache, must-revalidate");	  // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");															  // HTTP/1.0
print $strCon."\n";
?>